﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Site1.Master" AutoEventWireup="true" CodeBehind="Master_Family.aspx.cs" Inherits="ES_Project.Pages.WebForm5" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <style type="text/css">
        table{font-size:small;
margin-top: 0px;
    color: #000000;
}
TABLE {
	MARGIN-BOTTOM: 0px;
            margin-right: 0px;
        }
        .style3
        {
            width: 59px;
        }
        .style4
        {
            width: 1167px;
        }
    .DNNAlignright {
	TEXT-ALIGN: right
}
select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}
INPUT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px;
    text-align: left;
}
SELECT {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TEXTAREA {
	FONT: 700 small normal normal arial, helvetica, clean, sans-serif; COLOR: #057cc4; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
TH {
	FONT-FAMILY: Tahoma, Arial, Helvetica; COLOR: #003366; FONT-SIZE: 12px; VERTICAL-ALIGN: baseline; FONT-WEIGHT: bold
}
        .style15
        {
            width: 100%;
        }
        .style19
        {
            width: 47px;
        }
        .style20
        {
            width: 1167px;
            font-size: small;
        }
        .style29
        {
            font-size: small;
            text-align: left;
            }
        .style49
        {
            width: 138px;
        }
        .style51
        {
            font-size: small;
            text-align: left;
        }
        .style52
        {
            width: 163px;
        }
        .style54
        {
            TEXT-ALIGN: right;
            width: 64px;
        }
        .style55
        {
            width: 64px;
        }
    .style56
    {
        TEXT-ALIGN: right;
        width: 155px;
    }
    .style57
    {
        width: 155px;
    }
        .style58
        {
            color: #FF3300;
            font-size: small;
        }
      </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
  <SCRIPT language=javaScript type="text/javascript">
      function insert() {
          if (document.getElementById("ContentPlaceHolder1_TextBox4").value == "") {
              alert("กรุณาป้อนรหัสครอบครัว !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox5").value == "") {
              alert("กรุณาป้อนชื่อครอบครัว !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox4").value == "") {
              alert("กรุณาป้อนรหัสครอบครัว !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox5").value == "") {
              alert("กรุณาป้อนชื่อครอบครัว !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox13").value == "") {
              alert("กรุณาป้อนที่อยู่ !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox3").value == "") {
              alert("กรุณาป้อนข้อมูลใบเสร็จ !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox6").value == "") {
              alert("กรุณาป้อนชื่อ-นามสกุล บิดา !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox7").value == "") {
              alert("กรุณาป้อนเบอร์โทรศัพท์ของบิดา !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox10").value == "") {
              alert("กรุณาป้อนชื่อ-นามสกุล มารดา !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox11").value == "") {
              alert("กรุณาป้อนเบอร์โทรศัพท์ของมารดา !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox14").value == "") {
              alert("กรุณาป้อนชื่อ-นามสกุลผู้ปกครอง !");
              return (false);
          }
          if (document.getElementById("ContentPlaceHolder1_TextBox15").value == "") {
              alert("กรุณาป้อนเบอร์โทรศัพท์ของผู้ปกครอง !");
              return (false);
          }


          return true;
      }
 </script>
 

        <asp:ScriptManager ID="ScriptManager1" runat="server" />
  <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="0" class="style2">
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <strong>บันทึกรหัสของครอบครัว</strong></td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style15">
                            <tr>
                                <td class="style51">
                                    <table cellpadding="0" cellspacing="0" class="style15">
                                        <tr>
                                            <td class="DNNAlignright">
                                    <strong style="text-align: left">รหัสครอบครัว :</strong></td>
                                            <td>
                                    <asp:TextBox ID="TextBox4" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="DNNAlignright">
                                    <b style="text-align: left">ชื่อครอบครัว</b><b style="text-align: right"> :</b></td>
                                            <td>
                                    <asp:TextBox ID="TextBox5" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="style56">
                                                &nbsp;</td>
                                            <td colspan="3">
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:TextBox ID="family_id" runat="server" style="display:none" ></asp:TextBox>&nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style52">
                                                &nbsp;</td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="DNNAlignright">
                                                <strong style="text-align: right">ที่อยู่ :</strong></td>
                                            <td>
                                                <span class="style58">
                                                <textarea ID="TextArea2" runat="server"  cols="20" name="S1" rows="2"></textarea>*</span></td>
                                            <td class="DNNAlignright">
                                                <strong>ชื่อที่พิมพ์ในใบเสร็จ :</strong></td>
                                            <td>
                                                <asp:TextBox ID="TextBox3" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style52">
                                                &nbsp;</td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style52">
                                                &nbsp;</td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="DNNAlignright">
                                                <strong>ชื่อ-นามสกุล บิดา :</strong></td>
                                            <td>
                                    <asp:TextBox ID="TextBox6" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="DNNAlignright">
                                                <strong style="text-align: right">เบอร์โทรศัพท์ของบิดา :</strong></td>
                                            <td>
                                    <asp:TextBox ID="TextBox7" runat="server" Width="128px" ></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="style56">
                                                <strong>E-mailของบิดา :</strong></td>
                                            <td class="style52">
                                    <asp:TextBox ID="TextBox8" runat="server" Width="128px"></asp:TextBox>
                                            </td>
                                            <td class="style54">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style52">
                                                &nbsp;</td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="DNNAlignright">
                                                <strong>ชื่อ-นามสกุล มารดา :</strong></td>
                                            <td>
                                    <asp:TextBox ID="TextBox10" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="DNNAlignright">
                                                <strong style="text-align: right">เบอร์โทรศัพท์ของมารดา :</strong></td>
                                            <td>
                                    <asp:TextBox ID="TextBox11" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="style56">
                                                <strong>E-mailของมารดา :</strong></td>
                                            <td class="style52">
                                    <asp:TextBox ID="TextBox12" runat="server" Width="128px"></asp:TextBox>
                                            </td>
                                            <td class="style54">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style52">
                                                &nbsp;</td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="DNNAlignright">
                                                <strong style="text-align: right">ชื่อ-นามสกุลผู้ปกครอง :</strong></td>
                                            <td>
                                                <asp:TextBox ID="TextBox14" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="DNNAlignright">
                                                <strong>เบอร์โทรศัพท์ของผู้ปกครอง :</strong></td>
                                            <td>
                                                <asp:TextBox ID="TextBox15" runat="server" Width="128px"></asp:TextBox>
                                                <span class="style58">*</span></td>
                                            <td class="style56">
                                                <strong>E-mailของผู้ปกครอง :</strong></td>
                                            <td class="style52">
                                                <asp:TextBox ID="TextBox16" runat="server" Width="128px"></asp:TextBox>
                                            </td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td class="style57">
                                                &nbsp;</td>
                                            <td class="style52">
                                                &nbsp;</td>
                                            <td class="style55">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="style29">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style29">
                                    <table cellpadding="0" cellspacing="0" class="style15">
                                        <tr>
                                            <td class="style49">
                                                &nbsp;</td>
                                            <td>
                                    <asp:Button ID="Button3" runat="server" Text="  บันทึก  " Width="60px" OnClientClick="return insert()" 
                                        onclick="Button3_Click" Height="26px" />
                                    &nbsp;&nbsp;<asp:Button ID="Button7" runat="server" onclick="Button3_Click" 
                                        Text="  แก้ไข  " Width="60px" />
                                    &nbsp;&nbsp;<asp:Button ID="Button5" runat="server" Text="  เคลียร์  " Width="60px" 
                                                    onclick="Button5_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            </table>
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                    </td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style20">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onpageindexchanging="GridView1_PageIndexChanging" 
                            border="1" CellPadding="4" DataKeyNames="family_id" ForeColor="#333333" GridLines="None" 
                            onrowdatabound="GridView1_RowDataBound" 
                            onselectedindexchanged="GridView1_SelectedIndexChanged" Width="100%" 
                            AllowPaging="True" onrowdeleting="GridView1_RowDeleting">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                    <HeaderTemplate>
                                        ลำดับ
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <%#Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="id" Visible="False">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="HiddenField1" runat="server" 
                                            Value='<%# Eval("family_id") %>' Visible="false" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="family_code" HeaderText="รหัสครอบครัว" 
                                    ItemStyle-HorizontalAlign="Center" >
                                <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="family_name" HeaderText="ชื่อครอบครัว" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="father_name" HeaderText="ชื่อ-นามสกุลบิดา" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="phone_father" HeaderText="เบอร์โทรบิดา" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="email_father" HeaderText="E-mailบิดา" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="mother_name" HeaderText="ชื่อ-นามสกุลมารดา" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="phone_mother" HeaderText="เบอร์โทรมารดา" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="email_mother" HeaderText="E-mailมารดา" 
                                    ItemStyle-HorizontalAlign="left" >
                                <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                    SelectImageUrl="~/Pages/images/icon_15.gif" SelectText="" 
                                    ShowSelectButton="True" />
                             
                                   <asp:CommandField ButtonType="Image" HeaderText="ลบ" 
                                              ItemStyle-HorizontalAlign="Center" 
                                              SelectImageUrl="~/Pages/images/icon_del.gif"  
                                    ShowDeleteButton="True" DeleteImageUrl="~/Pages/images/icon_del.gif" 
                                    DeleteText="" >
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:CommandField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td class="style19">
                        &nbsp;</td>
                </tr>
            </table>
   </ContentTemplate>
  </asp:UpdatePanel>
     <br />

</asp:Content>

 